#!/usr/bin/python2

def find_smallest(arr):
    smallest  =  arr[0]
    smallest_index = 0
    arr_len = len(arr)
    for i in range(1, arr_len):
        if arr[i] < smallest:
            smallest = arr[i]
            smallest_index = i
    return smallest_index

def selection_sort(arr):
    new_arr = []
    arr_len = len(arr)
    for i in range(0, arr_len):
        smallest = find_smallest(arr)
        new_arr.append(arr.pop(smallest))
    return new_arr

list = [5, 3, 1, 6, 7, 10]
print selection_sort(list)
